* {
    box-sizing: border-box;
}
body {
    display: flex;
    height: 100vh;
    margin: 0;
    align-items: center;
    justify-content: center;
    background-color: #d8ebf9;
}

/* 计算器 */
.calculator {
    display: flex;
    flex-direction: column;
    padding: 30px;
    border-radius: 18px;
    box-shadow: 0 0 16px rgba(0, 0, 0, 0.1);
    background-color: #e0e5ec;
    color: #000;
}

/* 修改主题的开关 */
.theme-switch {
    width: 100%;
    display: flex;
    justify-content: flex-end;
}
.theme-switch-label {
    height: 26px;
    width: 52px;
    border-radius: 13px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    box-shadow: 6px 6px 16px 0 rgba(217, 210, 200, 0.51),
                -6px -6px 16px 0 rgba(255, 255, 255, 0.43),
                inset 6px 6px 5px 0 rgba(217, 210, 200, 0.51),
                inset -6px -6px 5px 0 rgba(255, 255, 255, 0.43);
}
.theme-switch-input {
    display: none;
}
/* 修改主题的开关圆圈 */
.theme-switch-circle {
    width: 22px;
    height: 22px;
    border-radius: 11px;
    background-color: #fff;
    transition: transform 0.4s;
}

/* 显示屏 */
.screen {
    width: 100%;
    height: 60px;
    margin-top: 15px;
    padding-right: 20px;
    border-radius: 12px;
    border: 4px solid rgba(255, 255, 255, 0.43);
    /* 水平对齐方式 */
    text-align: right;
    letter-spacing: 4px;
    color: rgb(51,64,89);
    font: 900 30px "Comic Sans MS", cursive, sans-serif;
    /* line-height 放在 font 下面才生效 */
    line-height: 60px;
    box-shadow: 6px 6px 16px 0 rgba(217, 210, 200, 0.51),
                -6px -6px 16px 0 rgba(255, 255, 255, 0.43),
                inset 6px 6px 5px 0 rgba(217, 210, 200, 0.51),
                inset -6px -6px 5px 0 rgba(255, 255, 255, 0.43);
    user-select: none;
}

/* 按键 */
.calc-buttons {
    width: 100%;
    margin-top: 40px;
    display: grid;
    grid-template: 
        'clear modulo divide multiply' 54px
        'seven eight nine subtract' 54px
        'four five six add' 54px
        'one two three equal' 54px
        'zero zero decimal equal' 54px / 54px 54px 54px 54px;
    gap: 25px;
}
.calc-buttons span {
    text-align: center;
    font: 900 16px "Comic Sans MS", cursive, sans-serif;
    line-height: 54px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.43);
    box-shadow: 6px 6px 16px 0 rgba(217, 210, 200, 0.51),
                -6px -6px 16px 0 rgba(255, 255, 255, 0.43);
    /* 修改游标 */
    cursor: pointer;
    /* 不可选中 */
    user-select: none;
}

.clear {grid-area: clear; }
.modulo {grid-area: modulo; }
.divide {grid-area: divide; }
.multiply {grid-area: multiply; }
.seven {grid-area: seven; }
.eight {grid-area: eight; }
.nine {grid-area: nine; }
.subtract {grid-area: subtract; }
.four {grid-area: four; }
.five {grid-area: five; }
.six {grid-area: six; }
.add {grid-area: add; }
.one {grid-area: one; }
.two {grid-area: two; }
.three {grid-area: three; }
.zero {grid-area: zero; }
.decimal {grid-area: decimal; }
.equal {grid-area: equal; }

.calc-buttons .zero, .calc-buttons .equal {
    border-radius: 15px;
}
.calc-buttons .equal {
    line-height: 133px;
}
.calc-buttons span:hover {
    color: rgb(51, 64, 89);
    box-shadow: inset 6px 6px 5px 0 rgba(217, 210, 200, 0.51),
                inset -6px -6px 5px 0 rgba(255, 255, 255, 0.43);
}

/* 修改主题的开关打开时 */
.theme-switch-input:checked + .theme-switch-label {
    background-color: #131419;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 6px 6px 16px 0 rgba(0, 0, 0, 0.51),
                -6px -6px 16px 0 rgba(255, 255, 255, 0.05),
                inset 6px 6px 5px 0 rgba(0, 0, 0, 0.51),
                inset -6px -6px 5px 0 rgba(255, 255, 255, 0.05);
}
.theme-switch-input:checked + .theme-switch-label > .theme-switch-circle {
    background-color: #03a9f4;
    transform: translateX(26px);
}

/* 黑色主题 */
.calculator.theme-dark {
    background-color: #131419;
    color: #c7c7c7;
}
/* 显示屏 */
.calculator.theme-dark .screen {
    box-shadow: 6px 6px 16px 0 rgba(0, 0, 0, 0.51),
                -6px -6px 16px 0 rgba(255, 255, 255, 0.05),
                inset 6px 6px 5px 0 rgba(0, 0, 0, 0.51),
                inset -6px -6px 5px 0 rgba(255, 255, 255, 0.05);
    border: 5px solid rgba(255, 255, 255, .05);
    color: #03a9f4;
}
/* 按键 */
.calculator.theme-dark .calc-buttons span {
    border: 1px solid rgba(255, 255, 255, .05);
    box-shadow: 6px 6px 16px 0 rgba(0, 0, 0, 0.51),
                -6px -6px 16px 0 rgba(255, 255, 255, 0.05);
}
.calculator.theme-dark .calc-buttons span:hover {
    color: #03a9f4;
    box-shadow: inset 6px 6px 5px 0 rgba(0, 0, 0, 0.51),
                inset -6px -6px 5px 0 rgba(255, 255, 255, 0.05);
}